import RequestUtils from '@/utils/RequestUtils'

export default {
  /**
   * 新增
   * @param params
   * @returns {AxiosPromise}
   */
  add(params = {}) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 批量删除（多个用逗号隔开）
   * @param ids
   * @returns {AxiosPromise}
   */
  remove(ids) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/${ids}`,
      method: 'DELETE'
    })
  },
  /**
   * 修改
   * @param params
   * @returns {AxiosPromise}
   */
  edit(params = {}) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement`,
      method: 'PUT',
      data: {
        ...params
      }
    })
  },
  /**
   * 详情
   * @param id
   * @returns {AxiosPromise}
   */
  get(id) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/${id}`,
      method: 'GET'
    })
  },
  /**
   * 列表
   * @param params
   * @returns {AxiosPromise}
   */
  list(params = {}) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/search`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 列表-分页
   * @param params
   * @returns {AxiosPromise}
   */
  page(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/search/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 单品销售视图
   * @param params
   * @returns {AxiosPromise}
   */
  skuSpuRateReport(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/skuSpuRateReport/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 单品销售视图
   * @param params
   * @returns {AxiosPromise}
   */
  skuSpuRateChartReport(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/skuSpuRateChartReport/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 单品销售排行视图
   * @param params
   * @returns {AxiosPromise}
   */
  skuRateView(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/skuRateView/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 品牌排行视图
   * @param params
   * @returns {AxiosPromise}
   */
  brandRateView(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/brandRateView/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 店铺排行视图
   * @param params
   * @returns {AxiosPromise}
   */
  storeRateView(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/storeRateView/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },

 /**
   * SPU排行视图
   * @param params
   * @returns {AxiosPromise}
   */
  spuRateView(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/spuRateView/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 供应商排行视图
   * @param params
   * @returns {AxiosPromise}
   */
  supplierRateView(params = {}, page) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/supplierRateView/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 导出
   * @param params
   * @returns {AxiosPromise}
   */
  exportData(params = {}) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/exportData`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 查询汇总
   * @param params
   * @returns {AxiosPromise}
   */
  reportSum(params = {}) {
    return RequestUtils({
      url: `/accounting/accApSkuMonthlySettlement/reportSum`,
      method: 'POST',
      data: {
        ...params
      }
    })
  }
}
